package com.lkl.hystrixdemo.order.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 循环引用问题
 */
@Service
public class TeacherService {

    //@Autowired
    StudentService studentService;

    public TeacherService() {
        System.out.println("teacherService is init...");
    }

    //@Autowired
    public TeacherService(StudentService studentService) {
        this.studentService = studentService;
    }

    @Autowired
    public void setStudentService(StudentService studentService) {
        this.studentService = studentService;
    }

    public void teach() {
        System.out.println("老师正在教学");
    }
}
